<template>
  <div>
    <School />
    <Student />
  </div>
</template>

<script>
import School from "./components/School.vue";
import Student from "./components/Student.vue";
import pubsub from "pubsub-js";
export default {
  name: "App",
  components: {
    School,
    Student,
  },
  mounted() {
    // this.$bus.$on("SchoolName", (name) => {
    //   alert(name);
    // });
    this.pubId = pubsub.subscribe("hello", (msgName, data) => {
      console.log(msgName, data);
    });
  },
  beforeDestroy() {
    // this.$bus.$off("SchoolName");
    pubsub.unsubscribe(pubId);
  },
};
</script>

